Ví dụ Phân_tích_cú_pháp

Sử dụng thư viện spaCy để phân tích cú pháp của câu "Apple is looking at buying U.K. startup for $1 billion" bằng ngôn ngữ Python.

import spacynlp = spacy.load("en_core_web_sm")doc = nlp("Apple is looking at buying U.K. startup for $1 billion")for token in doc:    print(token.text, token.lemma_, token.pos_, token.tag_, token.dep_,            token.shape_, token.is_alpha, token.is_stop)